<?php
	if (!isset($_COOKIE['cookieid'])) {
		header("Location: index.php");
	}
	$user_id = $_COOKIE['cookieid'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>엄지 정보</title>
</head>
<body style="margin: 0; padding: 0;">
<?
	require_once('con_db.php.inc');
	$thumb_id = $_GET['tID'];
	$is_detail = $_GET['is_detail'];
	
	$query = "SELECT * FROM thumb WHERE tID = $thumb_id";
	$data = mysql_query($query, $db)
		or die('엄지 ID에 해당하는 엄지 데이터 가져오는 쿼리 실패');
	if (mysql_num_rows($data) != 1)
		exit;
	$thumb = mysql_fetch_array($data);
	echo '<ul>'.
					'<li>만든이: '.$thumb['tmID'].'</li>'.
					'<li>엄지제목: '.$thumb['title'].'</li>'.
					'<li>날짜: '.$thumb['meetingtime'].'</li>'.
					'<li>장소: '.$thumb['location'].'</li>'.
					'<li>내용: '.$thumb['text'].'</li>'.
				'</ul>';
	if ($is_detail) {
		if ($user_id == $thumb['tmID'])
			echo '<a href="thumb_form.php?is_edit=1&tID='.$thumb_id.'">수정하기</a>';
		else
			echo '<a href="join_thumb.php?tID='.$thumb_id.'&joiner_id='.$user_id.'">여기붙기</a>';
		echo '&nbsp;';
		echo '<a href="javascript:window.close()">창닫기</a>';
	}	
?>
</body>
</html>